const { sendResult } = require('../utils/tools');

class UploadController {
	async upload(req, res, next) {
		// 返回路径，调用者拿到路径，再操作场景提交时，再将路径保存到数据库
		const imgPath = '/static/uploads/origin/' + req.file.filename;
		res.send(sendResult(imgPath, '文件上传成功'));
	}
}

module.exports = new UploadController();
